<!--多图多附件增减开始-->
<script type="text/javascript">
/*
* [string] method方法：thumb图片上传，file附件上传
 */
function AddRow(tab1,delbutton1,upmethod,inputMethod,moreNum,uptext,method){
    //添加一行
    var i = document.getElementById(tab1).rows.length;
    var newTr = document.getElementById(tab1).insertRow();
    var moreNum = moreNum + i;
    //添加列
    var newTd0 = newTr.insertCell();
    var newRow  =  '';
    if(method == 'file'){
	    newRow  += '<div class="row mb-2">';
        newRow  += '    <div class="col-md-12 px-2">';
        newRow  += '        <div class="input-group mb-2">';
        newRow  += '            <input name="file_arr[]" id="morefileurl'+moreNum+'" type="text" class="form-control" value="">';
		newRow  += '            <span class="input-group-append">';
		newRow  += '                <span class="btn btn-success" onclick="upFiles(\'#morefileurl'+moreNum+'\');"><i class="fa fa-cloud-upload-alt fa-fw mr-1"></i>'+uptext+'</span>';
		newRow  += '                <label class="btn btn-danger">';
        newRow  += '                    <input type="checkbox" class="d-none" id="'+delbutton1+'" onclick="javascript:DelRow(\''+tab1+'\',\''+delbutton1+'\');" />';
        newRow  += '                    <i class="fa fa-trash fa-fw mr-1"></i>{:lang('v_delete_this')}';
        newRow  += '                </label>';
		newRow  += '            </span>';
		newRow  += '        </div>';
		newRow  += '    </div>';
        // 未勾选：简单图片上传
        {if !in_array('thumb_simple',$isdisplay_array)}
    		newRow  += '    <div class="col-md-5 pl-2">';
    		newRow  += '        <div class="input-group mb-2">';
    		newRow  += '            <span class="input-group-prepend">';
    		newRow  += '                <span class="input-group-text h7">{:lang('v_size')}</span>';
    		newRow  += '            </span>';
    		newRow  += '            <input name="size_arr[]" type="number" class="form-control" value="">';
    		newRow  += '            <span class="input-group-append">';
    		newRow  += '                <span class="input-group-text h7">M</span>';
    		newRow  += '            </span>';
    		newRow  += '        </div>';
    		newRow  += '    </div>';
    		newRow  += '    <div class="col-md-7 pl-0 pr-2">';
    		newRow  += '        <div class="input-group mb-2">';
    		newRow  += '            <span class="input-group-prepend">';
    		newRow  += '                <span class="input-group-text h7">{:lang('v_title')}</span>';
    		newRow  += '            </span>';
    		newRow  += '            <input name="file_title_arr[]" type="text" class="form-control" value="">';
    		newRow  += '        </div>';
    		newRow  += '    </div>';
        {else /}
            newRow  += '            <input name="size_arr[]" type="hidden" value="">';
            newRow  += '            <input name="file_title_arr[]" type="hidden" value="">';
        {/if}
		newRow  += '</div>';
    }else{
    	newRow  += '<div class="row">';
        // 未勾选：简单图片上传
        {if !in_array('thumb_simple',$isdisplay_array)}
            newRow  += '    <div class="col-md-5 pl-2">';
            newRow  += '        <div class="input-group mb-2">';
            newRow  += '            <span class="input-group-prepend">';
            newRow  += '                <span class="input-group-text h7">{:lang('v_title')}</span>';
            newRow  += '            </span>';
            newRow  += '            <input name="thumb_title_arr[]" type="text" class="form-control" value="">';
            newRow  += '        </div>';
            newRow  += '    </div>';
            newRow  += '    <div class="col-md-7 pl-0 pr-2">';
            newRow  += '        <div class="input-group mb-2">';
            newRow  += '            <input name="thumb_arr[]" id="morepics'+moreNum+'" type="text" class="form-control" value="">';
            newRow  += '            <span class="input-group-append">';
            newRow  += '                <span class="btn btn-success" onclick="upImage(\'#morepics'+moreNum+'\');"><i class="fa fa-image fa-fw mr-1"></i>'+uptext+'</span>';
            newRow  += '                <label class="btn btn-danger">';
            newRow  += '                    <input type="checkbox" class="d-none" id="'+delbutton1+'" onclick="javascript:DelRow(\''+tab1+'\',\''+delbutton1+'\');" />';
            newRow  += '                    <i class="fa fa-trash fa-fw mr-1"></i>{:lang('v_delete_this')}';
            newRow  += '                </label>';
            newRow  += '            </span>';
            newRow  += '        </div>';
            newRow  += '    </div>';
        {else /}
            newRow  += '    <input name="thumb_title_arr[]" type="hidden" value="">';
            newRow  += '    <div class="col-md-12 px-2">';
            newRow  += '        <div class="input-group mb-2">';
            newRow  += '            <input name="thumb_arr[]" id="morepics'+moreNum+'" type="text" class="form-control" value="">';
            newRow  += '            <span class="input-group-append">';
            newRow  += '                <span class="btn btn-success" onclick="upImage(\'#morepics'+moreNum+'\');"><i class="fa fa-image fa-fw mr-1"></i>'+uptext+'</span>';
            newRow  += '                <label class="btn btn-danger">';
            newRow  += '                    <input type="checkbox" class="d-none" id="'+delbutton1+'" onclick="javascript:DelRow(\''+tab1+'\',\''+delbutton1+'\');" />';
            newRow  += '                    <i class="fa fa-trash fa-fw mr-1"></i>{:lang('v_delete_this')}';
            newRow  += '                </label>';
            newRow  += '            </span>';
            newRow  += '        </div>';
            newRow  += '    </div>';
        {/if}
        newRow  += '</div>';
    }
    newTd0.innerHTML = newRow;
}
</script>
{include file="public/js_del_row" /}
<!--多图多附件增减结束-->